[PATCH] dealing with mutiple HTTP 100 Continue responses

--Boundary-00=_6eqbBkZw5hRkRGG
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset="us-ascii"
Content-Disposition: inline

I have had a problem with sending a request with LWP::UserAgent to a server
that returns multiple 100 Continue responses after the request has been
written. The server responds with:

HTTP/1.1 100 Continue

HTTP/1.1 100 Continue

HTTP/1.1 100 Continue

HTTP/1.1 200 OK
....

This works okay when I do it over telnet, but with LWP::UserAgent it doesn't.
It seems to handle multiple 100 Continue responses while it is writing data,
but after will only accept one. I have attached a patch to the file
lib/LWP/Protocol/http.pm that seems to fix the problem.

Regards,
Thomas Yandell


--Boundary-00=_6eqbBkZw5hRkRGG
Content-Transfer-Encoding: 7bit
Content-Type: text/x-diff;
charset="us-ascii";
name="lwp.patch"
Content-Disposition: attachment;
filename="lwp.patch"

--- lib/LWP/Protocol/http.pm~ 2004-06-14 18:40:40.000000000 +0100
+++ lib/LWP/Protocol/http.pm 2004-10-14 17:11:02.979140012 +0100
[at] [at] -305,7 +305,7 [at] [at]
($code, $mess, [at] h) = $socket->read_response_headers(laxed => 1, junk_out => \ [at] junk)
unless $code;
($code, $mess, [at] h) = $socket->read_response_headers(laxed => 1, junk_out => \ [at] junk)
- if $code eq "100";
+ while $code eq "100";

my $response = HTTP::Response->new($code, $mess);
my $peer_http_version = $socket->peer_http_version;

--Boundary-00=_6eqbBkZw5hRkRGG--
tom.yandell [ Do, 14 Oktober 2004 18:22 ] [ ID #346223 ]
Perl » perl.libwww » [PATCH] dealing with mutiple HTTP 100 Continue responses

Vorheriges Thema: Byte Order Mark mucks up headers
Nächstes Thema: HTTP::TransparentCache uploaded to CPAN